otb_module_test()

set(OTBProjectionTests
otbProjectionTestDriver.cxx
otbVectorDataProjectionFilterFromGeoToMap.cxx
otbOrthoRectificationFilter.cxx
otbGCPsToRPCSensorModelImageFilterNew.cxx
otbMapProjection.cxx
otbGenericRSResampleImageFilter.cxx
otbGeometriesProjectionFilter.cxx
otbGenericRSTransformGenericTest.cxx
otbLeastSquareAffineTransformEstimatorNew.cxx
otbVectorDataTransformFilter.cxx
otbRationalTransformToDisplacementFieldSource.cxx
otbImportGeoInformationImageFilterNew.cxx
otbOrthoRectificationFilterWithDEM.cxx
otbGenericRSTransformGenericConversionCheckingFromGCP.cxx
otbVectorDataProjectionFilterFromMapToSensor.cxx
otbCompositeTransformNew.cxx
otbRationalTransform.cxx
otbGeometriesProjectionFilterFromMapToSensor.cxx
otbImageToEnvelopeVectorDataFilter.cxx
otbMapProjectionsNew.cxx
otbOrthoRectificationMonoThreadFilter.cxx
otbOrthoRectificationFilterNew.cxx
otbImageToGenericRSOutputParameters.cxx
otbGeometriesProjectionFilterFromMapToGeo.cxx
otbROIdataConversion.cxx
otbProjectionBaseNew.cxx
otbVectorDataProjectionFilterFromMapToGeo.cxx
otbPhysicalToRPCSensorModelImageFilter.cxx
otbGeometriesProjectionFilterFromGeoToMap.cxx
otbVectorDataProjectionFilterFromMapToImage.cxx
otbGenericRSTransformFromImage.cxx
otbCompositeTransform.cxx
otbLeastSquareAffineTransformEstimator.cxx
otbSpectralAngleDataNodeFeatureFunction.cxx
otbROIdataConversionNew.cxx
otbGCPsToRPCSensorModelImageFilterCheckRpcModel.cxx
otbGeographicalDistance.cxx
otbTileImageFilterRSTransformTest.cxx
otbGCPsToRPCSensorModelImageFilterAndOrtho.cxx
otbVectorDataIntoImageProjectionFilterTest.cxx
otbVectorDataExtractROIandProjection.cxx
otbGCPsToRPCSensorModelImageFilterWithoutDEM.cxx
otbGeometriesProjectionFilterFromMapToImage.cxx
otbGeometriesProjectionFilterFromMapToEPSG.cxx
otbVectorDataProjectionFilter.cxx
otbUtmMapProjection.cxx
otbVectorDataProjectionFilterNew.cxx
otbTileMapTransform.cxx
otbImportGeoInformationImageFilter.cxx
otbImportGeoInformationImageFilterWithKeywordList.cxx
)

add_executable(otbProjectionTestDriver ${OTBProjectionTests})
target_link_libraries(otbProjectionTestDriver ${OTBProjection-Test_LIBRARIES})
otb_module_target_label(otbProjectionTestDriver)

# Tests Declaration

otb_add_test(NAME prTuVectorDataProjectionFilterFromGeoToMap COMMAND otbProjectionTestDriver
  otbVectorDataProjectionFilterFromGeoToMap
  ${INPUTDATA}/ToulousePointsWGS.sqlite
  ${INPUTDATA}/QB_Toulouse_Ortho_PAN.tif
  ${TEMP}/prTvVectorDataProjectionFilterFromGeoToMap.shp
  )

otb_add_test(NAME prTvOrthoRectificationToulouse COMMAND otbProjectionTestDriver
  --compare-image ${EPSILON_4}  ${BASELINE}/prTvOrthoRectificationToulouse_UTM.tif
  ${TEMP}/prTvOrthoRectificationToulouse_UTM.tif
  otbOrthoRectificationFilter
  LARGEINPUT{QUICKBIRD/TOULOUSE/000000128955_01_P001_PAN/02APR01105228-P1BS-000000128955_01_P001.TIF}
  ${TEMP}/prTvOrthoRectificationToulouse_UTM.tif
  374100.8
  4829184.8
  500
  500
  0.5
  -0.5
  31
  N
  4 # Spacing of the displacement field
  )

otb_add_test(NAME prTvOrthoRectificationUTM_RADARSAT2_HV COMMAND otbProjectionTestDriver
  --compare-image ${EPSILON_4}  ${BASELINE}/prTvOrthoRectificationUTM_RADARSAT2_HV.tif
  ${TEMP}/prTvOrthoRectificationUTM_RADARSAT2_HV.tif
  otbOrthoRectificationFilter
  LARGEINPUT{RADARSAT2/ALTONA/Fine_Quad-Pol_Dataset/PK6621_DK406_FQ9_20080405_124900_HH_VV_HV_VH_SLC_Altona/imagery_HV.tif}
  ${TEMP}/prTvOrthoRectificationUTM_RADARSAT2_HV.tif
  611000.953075 5439991.842531
  200        200 10 -10 14 N 4
  )

otb_add_test(NAME prTvOrthoRectificationSPOT5 COMMAND otbProjectionTestDriver
  --compare-image ${EPSILON_4}  ${BASELINE}/prTvOrthoRectificationSPOT5_UTM.tif
  ${TEMP}/prTvOrthoRectificationSPOT5_UTM.tif
  otbOrthoRectificationFilter
  LARGEINPUT{SPOT5/TEHERAN/IMAGERY.TIF}
  ${TEMP}/prTvOrthoRectificationSPOT5_UTM.tif
  536187
  3950748
  500
  500
  5
  -5
  39
  N
  50
  )

otb_add_test(NAME prTvOrthoRectificationUTM_RADARSAT2_XML COMMAND otbProjectionTestDriver
  --compare-image ${EPSILON_4}  ${BASELINE}/prTvOrthoRectificationUTM_RADARSAT2.tif
  ${TEMP}/prTvOrthoRectificationUTM_RADARSAT2.tif
  otbOrthoRectificationFilter
  LARGEINPUT{RADARSAT2/ALTONA/Fine_Quad-Pol_Dataset/PK6621_DK406_FQ9_20080405_124900_HH_VV_HV_VH_SLC_Altona/product.xml}
  ${TEMP}/prTvOrthoRectificationUTM_RADARSAT2.tif
  611000.953075 5439991.842531
  200        200 10 -10 14 N 4
  )

otb_add_test(NAME prTvOrthoRectificationUTM_RADARDSAT1 COMMAND otbProjectionTestDriver
  --compare-image ${EPSILON_4}  ${BASELINE}/prTvOrthoRectificationUTM_RADARDSAT1.tif
  ${TEMP}/prTvOrthoRectificationUTM_RADARDSAT1.tif
  otbOrthoRectificationFilter
  LARGEINPUT{RADARSAT1/GOMA/SCENE01/}
  ${TEMP}/prTvOrthoRectificationUTM_RADARDSAT1.tif
  755929.75 9821313.25
  200        200 10 -10 35 S 4
  )

otb_add_test(NAME prTvOrthoRectificationUTM_PALSAR COMMAND otbProjectionTestDriver
  --compare-image ${EPSILON_4}  ${BASELINE}/prTvOrthoRectificationUTM_PALSAR.tif
  ${TEMP}/prTvOrthoRectificationUTM_PALSAR.tif
  otbOrthoRectificationComplexFilter
  LARGEINPUT{PALSAR/200801280007/l1data/VOL-ALPSRP037120700-H1.1__A}
  ${TEMP}/prTvOrthoRectificationUTM_PALSAR.tif
  309298.731439 3909055.130746
  200        200 10 -10 54 N 4
  )

otb_add_test(NAME prTvOrthoRectificationCevennes COMMAND otbProjectionTestDriver
  --compare-image ${EPSILON_4}  ${BASELINE}/prTvOrthoRectificationCevennes_UTM.tif
  ${TEMP}/prTvOrthoRectificationCevennes_UTM.tif
  otbOrthoRectificationFilter
  LARGEINPUT{QUICKBIRD/CEVENNES/06FEB12104912-P1BS-005533998070_01_P001.TIF}
  ${TEMP}/prTvOrthoRectificationCevennes_UTM.tif
  556046
  4.881e+06
  500
  500
  0.5
  -0.5
  31
  N
  4
  )

otb_add_test(NAME prTvOrthoRectificationUTM_TERRASARX_VV COMMAND otbProjectionTestDriver
  --compare-image ${EPSILON_4}  ${BASELINE}/prTvOrthoRectificationUTM_TERRASARX_VV.tif
  ${TEMP}/prTvOrthoRectificationUTM_TERRASARX_VV.tif
  otbOrthoRectificationComplexFilter
  LARGEINPUT{TERRASARX/PANGKALANBUUN/IMAGEDATA/IMAGE_VV_SRA_stripFar_008.cos}
  ${TEMP}/prTvOrthoRectificationUTM_TERRASARX_VV.tif
  591992.001073 9699689.825866
  200        200 10 -10 49 S 4
  )

otb_add_test(NAME prTvOrthoRectificationUTM_RADARSAT2_VV COMMAND otbProjectionTestDriver
  --compare-image ${EPSILON_4}  ${BASELINE}/prTvOrthoRectificationUTM_RADARSAT2_VV.tif
  ${TEMP}/prTvOrthoRectificationUTM_RADARSAT2_VV.tif
  otbOrthoRectificationFilter
  LARGEINPUT{RADARSAT2/ALTONA/Fine_Quad-Pol_Dataset/PK6621_DK406_FQ9_20080405_124900_HH_VV_HV_VH_SLC_Altona/imagery_VV.tif}
  ${TEMP}/prTvOrthoRectificationUTM_RADARSAT2_VV.tif
  611000.953075 5439991.842531
  200        200 10 -10 14 N 4
  )

otb_add_test(NAME prTvOrthoRectificationUTM_ENVISAT COMMAND otbProjectionTestDriver
  --compare-image ${EPSILON_4}  ${BASELINE}/prTvOrthoRectificationUTM_ENVISAT.tif
  ${TEMP}/prTvOrthoRectificationUTM_ENVISAT.tif
  otbOrthoRectificationComplexFilter
  LARGEINPUT{ENVISAT_ASAR_SCENE01/ASA_APS_1PNDPA20030821_7713.N1}
  ${TEMP}/prTvOrthoRectificationUTM_ENVISAT.tif
  655696.679130 4906584.046495
  200        200 10 -10 30 N 4
  )

otb_add_test(NAME prTvOrthoRectificationUTM_TERRASARX_HH COMMAND otbProjectionTestDriver
  --compare-image ${EPSILON_4}  ${BASELINE}/prTvOrthoRectificationUTM_TERRASARX_HH.tif
  ${TEMP}/prTvOrthoRectificationUTM_TERRASARX_HH.tif
  otbOrthoRectificationComplexFilter
  LARGEINPUT{TERRASARX/PANGKALANBUUN/IMAGEDATA/IMAGE_HH_SRA_stripFar_008.cos}
  ${TEMP}/prTvOrthoRectificationUTM_TERRASARX_HH.tif
  591992.001073 9699689.825866
  200        200 10 -10 49 S 4
  )

otb_add_test(NAME prTvOrthoRectificationToulouseXS COMMAND otbProjectionTestDriver
  --compare-image ${EPSILON_4}  ${BASELINE}/prTvOrthoRectificationToulouseXS_UTM.tif
  ${TEMP}/prTvOrthoRectificationToulouseXS_UTM.tif
  otbOrthoRectificationFilter
  LARGEINPUT{QUICKBIRD/TOULOUSE/000000128955_01_P001_MUL/02APR01105228-M1BS-000000128955_01_P001.TIF}
  ${TEMP}/prTvOrthoRectificationToulouseXS_UTM.tif
  367319 4835740 300 300 2.5608 -2.8452 31 N 4
  )

otb_add_test(NAME prTvOrthoRectificationUTM_RADARSAT2_HH COMMAND otbProjectionTestDriver
  --compare-image ${EPSILON_4}  ${BASELINE}/prTvOrthoRectificationUTM_RADARSAT2_XML.tif
  ${TEMP}/prTvOrthoRectificationUTM_RADARSAT2_XML.tif
  otbOrthoRectificationFilter
  LARGEINPUT{RADARSAT2/ALTONA/Fine_Quad-Pol_Dataset/PK6621_DK406_FQ9_20080405_124900_HH_VV_HV_VH_SLC_Altona/imagery_HH.tif}
  ${TEMP}/prTvOrthoRectificationUTM_RADARSAT2_XML.tif
  611000.953075 5439991.842531
  200        200 10 -10 14 N 4
  )

otb_add_test(NAME prTvOrthoRectificationUTM_RADARSAT2_VH COMMAND otbProjectionTestDriver
  --compare-image ${EPSILON_4}  ${BASELINE}/prTvOrthoRectificationUTM_RADARSAT2_VH.tif
  ${TEMP}/prTvOrthoRectificationUTM_RADARSAT2_VH.tif
  otbOrthoRectificationFilter
  LARGEINPUT{RADARSAT2/ALTONA/Fine_Quad-Pol_Dataset/PK6621_DK406_FQ9_20080405_124900_HH_VV_HV_VH_SLC_Altona/imagery_VH.tif}
  ${TEMP}/prTvOrthoRectificationUTM_RADARSAT2_VH.tif
  611000.953075 5439991.842531
  200        200 10 -10 14 N 4
  )

otb_add_test(NAME prTuGCPsToRPCSensorModelImageFilterNew COMMAND otbProjectionTestDriver
  otbGCPsToRPCSensorModelImageFilterNew)

otb_add_test(NAME prTvMapProjection COMMAND otbProjectionTestDriver
  --compare-ascii ${EPSILON_4} ${BASELINE_FILES}/prTvMapProjection.txt
  ${TEMP}/prTvMapProjection.txt
  otbMapProjection
  ${TEMP}/prTvMapProjection.txt
  )

otb_add_test(NAME prTuotbGenericRSResampleImageFilterNew COMMAND otbProjectionTestDriver
  otbGenericRSResampleImageFilterNew
  )

otb_add_test(NAME prTvotbGenericRSResampleImageFilter COMMAND otbProjectionTestDriver
  --compare-image ${EPSILON_4}
  ${BASELINE}/prTvotbGenericRSResampleImageFilterOutput.tif
  ${TEMP}/prTvotbGenericRSResampleImageFilterOutput.tif
  otbGenericRSResampleImageFilter
  LARGEINPUT{QUICKBIRD/TOULOUSE/000000128955_01_P001_PAN/02APR01105228-P1BS-000000128955_01_P001.TIF}
  1000
  15
  0
  1
  ${TEMP}/prTvotbGenericRSResampleImageFilterOutput.tif
  )

otb_add_test(NAME prTvGeometriesProjectionFilterLines COMMAND otbProjectionTestDriver
  --compare-ogr ${NOTOL}
  ${BASELINE_FILES}/prTvVectorDataProjectionFilterLines.shp
  ${TEMP}/prTvGeometriesProjectionFilterLines.shp
  otbGeometriesProjectionFilter
  ${INPUTDATA}/ToulouseRoad-examples.shp
  ${TEMP}/prTvGeometriesProjectionFilterLines.shp
  )

otb_add_test(NAME prTvGeometriesProjectionFilterPoints COMMAND otbProjectionTestDriver
  --compare-ogr ${NOTOL}
  ${BASELINE_FILES}/prTvVectorDataProjectionFilterPoints.shp
  ${TEMP}/prTvGeometriesProjectionFilterPoints.shp
  otbGeometriesProjectionFilter
  ${INPUTDATA}/ToulousePoints-examples.shp
  ${TEMP}/prTvGeometriesProjectionFilterPoints.shp
  )

otb_add_test(NAME prTvGeometriesProjectionFilterPolygons COMMAND otbProjectionTestDriver
  --compare-ogr  ${NOTOL}
  ${BASELINE_FILES}/prTvVectorDataProjectionFilterPolygons.shp
  ${TEMP}/prTvGeometriesProjectionFilterPolygons.shp
  otbGeometriesProjectionFilter
  ${INPUTDATA}/Capitole-Shadows.shp
  ${TEMP}/prTvGeometriesProjectionFilterPolygons.shp
  )

otb_add_test(NAME prTvGenericRSTransformGenericTestEPSG4326toEPSG32631 COMMAND otbProjectionTestDriver
  otbGenericRSTransformGenericTest
  1.3561728980 43.4876035537 367077.72312001337 4816277.086791252 EPSG 4326 EPSG 32631 GEO 1e-3 PHYSICAL 1e-3 NOELEV)

otb_add_test(NAME prTvGenericRSTransformGenericTestWGS84toEPSG3857 COMMAND otbProjectionTestDriver
  otbGenericRSTransformGenericTest
  1.48353 43.55968 165145.804154 5397552.58726 EPSG 4326 EPSG 3857 GEO 1e-3 PHYSICAL 1e-3 NOELEV)

otb_add_test(NAME prTvGenericRSTransformGenericTestEPSG4326toEPSG4326 COMMAND otbProjectionTestDriver
  otbGenericRSTransformGenericTest
  1.35617289802566 43.4876035537 1.35617289802566 43.4876035537 EPSG 4326 EPSG 4326 GEO 1e-6 GEO 1e-6 NOELEV)

otb_add_test(NAME prTuLeastSquareAffineTransformEstimatorNew COMMAND otbProjectionTestDriver
  otbLeastSquareAffineTransformEstimatorNew)

otb_add_test(NAME prTuVectorDataTransformFilterNew COMMAND otbProjectionTestDriver
  otbVectorDataTransformFilterNew)

otb_add_test(NAME prTvVectorDataTransformFilter COMMAND otbProjectionTestDriver
  --compare-ogr ${EPSILON_4}
  ${BASELINE_FILES}/prTvVectorDataTransformFilter_Translation.shp
  ${TEMP}/prTvVectorDataTransformFilter_Translation.shp
  otbVectorDataTransformFilter
  LARGEINPUT{QUICKBIRD/TOULOUSE/000000128955_01_P001_MUL/02APR01105228-M1BS-000000128955_01_P001.TIF}
  ${INPUTDATA}/ToulouseRoad-examples.shp
  ${TEMP}/prTvVectorDataTransformFilter_Translation.shp
  )

otb_add_test(NAME prTvRationalTransformToDisplacementFieldSourceTest COMMAND otbProjectionTestDriver
  --compare-image ${EPSILON_9}  ${BASELINE}/prTvRationalTransformToDisplacementFieldSourceTest.hdr
  ${TEMP}/prTvRationalTransformToDisplacementFieldSourceTest.hdr
  otbRationalTransformToDisplacementFieldSourceTest
  ${TEMP}/prTvRationalTransformToDisplacementFieldSourceTest.hdr
  )

otb_add_test(NAME bfTuImportGeoInformationImageFilterNew COMMAND otbProjectionTestDriver
  otbImportGeoInformationImageFilterNew)

otb_add_test(NAME prTvOrthoRectificationCoastalZoneWithSRTMNoData COMMAND otbProjectionTestDriver
  --compare-image ${EPSILON_4}  ${BASELINE}/prTvOrthoRectificationCoastalZoneWithSRTMNoData.tif
  ${TEMP}/prTvOrthoRectificationCoastalZoneWithSRTMNoData.tif
  otbOrthoRectificationFilterWithDEM
  ${INPUTDATA}/qb_coastal.tif
  ${TEMP}/prTvOrthoRectificationCoastalZoneWithSRTMNoData.tif
  536724
  4.07959e+06
  741
  781
  24
  -24
  31
  N
  ${INPUTDATA}/DEM/srtm_directory/
  24
  )

otb_add_test(NAME prTvOrthoRectificationCevennesWithDEM COMMAND otbProjectionTestDriver
  --compare-image ${EPSILON_4}  ${BASELINE}/prTvOrthoRectificationCevennesWithDEM_UTM.tif
  ${TEMP}/prTvOrthoRectificationCevennesWithDEM_UTM.tif
  otbOrthoRectificationFilterWithDEM
  LARGEINPUT{QUICKBIRD/CEVENNES/06FEB12104912-P1BS-005533998070_01_P001.TIF}
  ${TEMP}/prTvOrthoRectificationCevennesWithDEM_UTM.tif
  556046
  4.881e+06
  500
  500
  0.5
  -0.5
  31
  N
  ${INPUTDATA}/DEM/srtm_directory/
  0.5
  )

otb_add_test(NAME prTvOrthoRectificationToulouseWithDEM COMMAND otbProjectionTestDriver
  --compare-image ${EPSILON_4}  ${BASELINE}/prTvOrthoRectificationToulouseWithDEM_UTM.tif
  ${TEMP}/prTvOrthoRectificationToulouseWithDEM_UTM.tif
  otbOrthoRectificationFilterWithDEM
  LARGEINPUT{QUICKBIRD/TOULOUSE/000000128955_01_P001_PAN/02APR01105228-P1BS-000000128955_01_P001.TIF}
  ${TEMP}/prTvOrthoRectificationToulouseWithDEM_UTM.tif
  374100.8
  4829184.8
  500
  500
  0.5
  -0.5
  31
  N
  ${INPUTDATA}/DEM/srtm_directory/
  0.5
  )

otb_add_test(NAME prTvVectorDataProjectionFilterFromMapToSensor COMMAND otbProjectionTestDriver
  --compare-ogr  ${NOTOL}
  ${BASELINE_FILES}/prTvVectorDataProjectionFilterFromMapToSensor.shp
  ${TEMP}/prTvVectorDataProjectionFilterFromMapToSensor.shp
  otbVectorDataProjectionFilterFromMapToSensor
  ${INPUTDATA}/ToulousePoints-examples.shp
  LARGEINPUT{QUICKBIRD/TOULOUSE/000000128955_01_P001_PAN/02APR01105228-P1BS-000000128955_01_P001.TIF}
  ${TEMP}/prTvVectorDataProjectionFilterFromMapToSensor.shp
  )

otb_add_test(NAME prTuCompositeTransformNew COMMAND otbProjectionTestDriver  otbCompositeTransformNew )

otb_add_test(NAME prTvRationalTransform COMMAND otbProjectionTestDriver
  --compare-ascii ${NOTOL}
  ${BASELINE_FILES}/otbRationalTransformOutput.txt
  ${TEMP}/otbRationalTransformOutput.txt
  otbRationalTransform
  ${TEMP}/otbRationalTransformOutput.txt
  0 0
  1 1
  10 10
  -10 -10
  )

otb_add_test(NAME prTuRationalTransformNew COMMAND otbProjectionTestDriver
  otbRationalTransformNew)

otb_add_test(NAME prTvGeometriesProjectionFilterFromMapToSensor COMMAND otbProjectionTestDriver
  --compare-ogr  ${NOTOL}
  ${BASELINE_FILES}/prTvVectorDataProjectionFilterFromMapToSensor.shp
  ${TEMP}/prTvGeometriesProjectionFilterFromMapToSensor.shp
  otbGeometriesProjectionFilterFromMapToSensor
  ${INPUTDATA}/ToulousePoints-examples.shp
  LARGEINPUT{QUICKBIRD/TOULOUSE/000000128955_01_P001_PAN/02APR01105228-P1BS-000000128955_01_P001.TIF}
  ${TEMP}/prTvGeometriesProjectionFilterFromMapToSensor.shp
  )

otb_add_test(NAME prTvImageToEnvelopeVectorDataFilter COMMAND otbProjectionTestDriver
  --compare-ogr ${EPSILON_6}
  ${BASELINE_FILES}/prTvImageToEnvelopeVectorDataFilterOutput.kml
  ${TEMP}/prTvImageToEnvelopeVectorDataFilterOutput.kml
  otbImageToEnvelopeVectorDataFilter
  LARGEINPUT{QUICKBIRD/TOULOUSE/000000128955_01_P001_PAN/02APR01105228-P1BS-000000128955_01_P001.TIF}
  ${TEMP}/prTvImageToEnvelopeVectorDataFilterOutput.kml
  )

otb_add_test(NAME prTuImageToEnvelopeVectorDataFilterNew COMMAND otbProjectionTestDriver
  otbImageToEnvelopeVectorDataFilterNew)

otb_add_test(NAME prTuMapProjectionsNew COMMAND otbProjectionTestDriver  otbMapProjectionsNew )

otb_add_test(NAME prTvMapProjectionsTest COMMAND otbProjectionTestDriver
  --compare-ascii ${EPSILON_4} ${BASELINE_FILES}/prTvMapProjectionsTest.txt
  ${TEMP}/prTvMapProjectionsTest.txt
  otbMapProjectionsTest
  ${TEMP}/prTvMapProjectionsTest.txt
  )

otb_add_test(NAME prTvOrthoRectificationMonoThreadSPOT5 COMMAND otbProjectionTestDriver
  --compare-image ${EPSILON_4}  ${BASELINE}/prTvOrthoRectificationSPOT5_UTM_band1.tif
  ${TEMP}/prTvOrthoRectificationMonoThreadSPOT5_UTM.tif
  otbOrthoRectificationMonoThreadFilter
  LARGEINPUT{SPOT5/TEHERAN/IMAGERY.TIF}
  ${TEMP}/prTvOrthoRectificationMonoThreadSPOT5_UTM.tif
  536187
  3950748
  500
  500
  5
  -5
  39
  N
  50
  )

otb_add_test(NAME prTuOrthoRectificationFilterNew COMMAND otbProjectionTestDriver
  otbOrthoRectificationFilterNew )

otb_add_test(NAME prTvImageToGenericRSOutputParameters COMMAND otbProjectionTestDriver
  --compare-ascii ${NOTOL}
  ${BASELINE_FILES}/prTvImageToGenericRSOutputParametersOutput.txt
  ${TEMP}/prTvImageToGenericRSOutputParametersOutput.txt
  otbImageToGenericRSOutputParameters
  LARGEINPUT{QUICKBIRD/TOULOUSE/000000128955_01_P001_PAN/02APR01105228-P1BS-000000128955_01_P001.TIF}
  ${TEMP}/prTvImageToGenericRSOutputParametersOutput.txt
  )

otb_add_test(NAME prTuImageToGenericRSOutputParametersNew COMMAND otbProjectionTestDriver
  otbImageToGenericRSOutputParametersNew)

otb_add_test(NAME prTvGeometriesProjectionFilterFromMapToGeo COMMAND otbProjectionTestDriver
  --compare-ogr ${NOTOL}
  ${BASELINE_FILES}/prTvVectorDataProjectionFilterFromMapToGeo.kml
  ${TEMP}/prTvGeometriesProjectionFilterFromMapToGeo.kml
  otbGeometriesProjectionFilterFromMapToGeo
  ${INPUTDATA}/ToulousePoints-examples.shp
  ${TEMP}/prTvGeometriesProjectionFilterFromMapToGeo.kml
  )

otb_add_test(NAME leTvROIdataConversion COMMAND otbProjectionTestDriver
  --compare-ascii ${NOTOL}
  ${BASELINE_FILES}/leTvROIdataConversion.txt
  ${TEMP}/leTvROIdataConversion.txt
  otbROIdataConversion
  ${INPUTDATA}/ImageLineDir.bsq.hdr
  ${INPUTDATA}/ImageLine.bsq.hdr
  ${TEMP}/leTvROIdataConversion.txt
  )

otb_add_test(NAME prTuProjectionBaseNew COMMAND otbProjectionTestDriver  otbProjectionBaseNew )

otb_add_test(NAME prTvVectorDataProjectionFilterFromMapToGeo COMMAND otbProjectionTestDriver
  --compare-ogr ${NOTOL}
  ${BASELINE_FILES}/prTvVectorDataProjectionFilterFromMapToGeo.kml
  ${TEMP}/prTvVectorDataProjectionFilterFromMapToGeo.kml
  otbVectorDataProjectionFilterFromMapToGeo
  ${INPUTDATA}/ToulousePoints-examples.shp
  ${TEMP}/prTvVectorDataProjectionFilterFromMapToGeo.kml
  )

otb_add_test(NAME prTvPhysicalToRPCSensorModelImageFilter COMMAND otbProjectionTestDriver
  otbPhysicalToRPCSensorModelImageFilter
  ${INPUTDATA}/ToulouseExtract_WithGeom.tif
  15
  ${TEMP}/prTvotbPhysicalToRPCSensorModelImageFilter.tif
  )

otb_add_test(NAME prTuPhysicalToRPCSensorModelImageFilterNew COMMAND otbProjectionTestDriver
  otbPhysicalToRPCSensorModelImageFilter
  )

otb_add_test(NAME prTuGeometriesProjectionFilterFromGeoToMap COMMAND otbProjectionTestDriver
  otbGeometriesProjectionFilterFromGeoToMap
  ${INPUTDATA}/ToulousePointsWGS.sqlite
  ${INPUTDATA}/QB_Toulouse_Ortho_PAN.tif
  ${TEMP}/prTvGeometriesProjectionFilterFromGeoToMap.shp
  )

otb_add_test(NAME prTvVectorDataProjectionFilterFromMapToImage COMMAND otbProjectionTestDriver
  --compare-ogr ${NOTOL}
  ${BASELINE_FILES}/prTvVectorDataProjectionFilterFromMapToImage.shp
  ${TEMP}/prTvVectorDataProjectionFilterFromMapToImage.shp
  otbVectorDataProjectionFilterFromMapToImage
  ${INPUTDATA}/ToulousePoints-examples.shp
  ${INPUTDATA}/QB_Toulouse_Ortho_PAN.tif
  ${TEMP}/prTvVectorDataProjectionFilterFromMapToImage.shp
  )

otb_add_test(NAME prTvGenericRSTransformPleiadesToulouseGeodesicPointChecking COMMAND otbProjectionTestDriver
  otbGenericRSTransformImageAndMNTToWGS84ConversionChecking
  LARGEINPUT{PLEIADES/TLSE_JP2_DIMAPv2_PRIMARY_PMS_lossless_12bits/IMGPHR_201222215194743808/IMG_PHR1A_PMS_201201151100183_SEN_IPU_20120222_0901-001_R2C1.JP2}
  ${INPUTDATA}/DEM/srtm_directory/
  ${INPUTDATA}/DEM/egm96.grd
  20000 28010 # IGN reference point based inside CNES (site 31555A point c)
  1.48353 43.55968 # IGN reference point lon/lat
  192.205 # IGN reference point elevation (prec < 10 cm)
  37 # Tolerance in pixels (performances in february 2012)
  20 # Tolerance in meters (performances in february 2012)
  )

otb_add_test(NAME prTvGenericRSTransformPleiadesToulouseGeodesicPointChecking_PRE COMMAND otbProjectionTestDriver
  otbGenericRSTransformImageAndMNTToWGS84ConversionChecking
  LARGEINPUT{PLEIADES-PRE/TLSE_TIFF_PRIMARY_DIMAPv2_MS_lossly_12bits/IMG_PHR1A_MS_002/IMG_PHR1A_MS_201006181052297_SEN_IPU_20111025_3077-004_R1C1.TIF}
  ${INPUTDATA}/DEM/srtm_directory/
  ${INPUTDATA}/DEM/egm96.grd
  6933 6472 # IGN reference point based inside CNES (site 31555A point c)
  1.48353 43.55968 # IGN reference point lon/lat
  192.205 # IGN reference point elevation (prec < 10 cm)
  35 # Tolerance in pixels (performances in february 2012)
  20 # Tolerance in meters (performances in february 2012)
  )

otb_add_test(NAME prTvGenericRSTransformFromImage COMMAND otbProjectionTestDriver
  otbGenericRSTransformFromImage
  ${INPUTDATA}/WithoutProjRefWithKeywordlist.tif)

otb_add_test(NAME prTvGenericRSTransformQuickbirdToulouseGeodesicPointChecking COMMAND otbProjectionTestDriver
  otbGenericRSTransformImageAndMNTToWGS84ConversionChecking
  LARGEINPUT{QUICKBIRD/TOULOUSE/000000128955_01_P001_PAN/02APR01105228-P1BS-000000128955_01_P001.TIF}
  ${INPUTDATA}/DEM/srtm_directory/
  ${INPUTDATA}/DEM/egm96.grd
  16271 15647 # IGN reference point based inside CNES (site 31555A point c)
  1.48353 43.55968 # IGN reference point lon/lat
  192.205 # IGN reference point elevation (prec < 10 cm)
  24 # Tolerance in pixels according to DigitalGlobe specification
  23 # Tolerance in meters according to DigitalGlobe specification
  )




otb_add_test(NAME prTvCompositeTransform COMMAND otbProjectionTestDriver
  --compare-ascii ${EPSILON_4} ${BASELINE_FILES}/prTvCompositeTransform.txt
  ${TEMP}/prTvCompositeTransform.txt
  otbCompositeTransform
  LARGEINPUT{QUICKBIRD/TOULOUSE/000000128955_01_P001_PAN/02APR01105228-P1BS-000000128955_01_P001.TIF}
  ${TEMP}/prTvCompositeTransform.txt
  )

otb_add_test(NAME prTvLeastSquareAffineTransformEstimator COMMAND otbProjectionTestDriver
  --compare-ascii ${NOTOL}
  ${BASELINE_FILES}/otbLeastSquareAffineTransformEstimatorOutput.txt
  ${TEMP}/otbLeastSquareAffineTransformEstimatorOutput.txt
  otbLeastSquareAffineTransformEstimator
  ${TEMP}/otbLeastSquareAffineTransformEstimatorOutput.txt
  840 394 783 7907 9925 11943
  798 911 197 5831 7738 9645
  335 768 277 5356 6737 8118
  553 477 628 6867 8526 10185
  364 513 952 9090 10920 12750
  916 635 717 8485 10754 13023
  141 606 16 2687 3451 4215
  242 137 804 6428 7612 8796
  156 400 129 2669 3355 4041
  108 998 218 5636 6961 8286
  512 839 612 8162 10126 12090
  296 637 524 6522 7980 9438
  493 972 292 6435 8193 9951
  771 526 769 8268 10335 12402
  400 891 283 5955 7530 9105
  352 807 919 10023 12102 14181
  )

otb_add_test(NAME bfTvSpectralAngleDataNodeFeatureFunction_Polygon COMMAND otbProjectionTestDriver
  --compare-ogr ${NOTOL}
  ${BASELINE_FILES}/bfTvSpectralAngleDataNodeFeatureFunctionOutput_Polygon.shp
  ${TEMP}/bfTvSpectralAngleDataNodeFeatureFunctionOutput_Polygon.shp
  otbSpectralAngleDataNodeFeatureFunction
  ${INPUTDATA}/Dempster-Shafer/ROI_QB_TOULOUSE_BUILDINGS.shp
  ${INPUTDATA}/Dempster-Shafer/ROI_QB_TOULOUSE.TIF
  ${INPUTDATA}/DEM/srtm_directory
  ${TEMP}/bfTvSpectralAngleDataNodeFeatureFunctionOutput_Polygon.shp
  0 )

otb_add_test(NAME bfTuSpectralAngleDataNodeFeatureFunctionNew COMMAND otbProjectionTestDriver
  otbSpectralAngleDataNodeFeatureFunctionNew
  )

otb_add_test(NAME bfTvSpectralAngleDataNodeFeatureFunction_Line COMMAND otbProjectionTestDriver
  --compare-ogr ${NOTOL}
  ${BASELINE_FILES}/bfTvSpectralAngleDataNodeFeatureFunctionOutput_Line.shp
  ${TEMP}/bfTvSpectralAngleDataNodeFeatureFunctionOutput_Line.shp
  otbSpectralAngleDataNodeFeatureFunction
  ${INPUTDATA}/Dempster-Shafer/ROI_QB_TOULOUSE_ROADS.shp
  ${INPUTDATA}/Dempster-Shafer/ROI_QB_TOULOUSE.TIF
  ${INPUTDATA}/DEM/srtm_directory
  ${TEMP}/bfTvSpectralAngleDataNodeFeatureFunctionOutput_Line.shp
  0
  )

otb_add_test(NAME leTuROIdataConversionNew COMMAND otbProjectionTestDriver
  otbROIdataConversionNew)

otb_add_test(NAME prTvGCPsToRPCSensorModelImageCheckInputGcpPointsProjection_WithDEM COMMAND otbProjectionTestDriver
  otbGCPsToRPCSensorModelImageFilterCheckRpcModel
  -in ${INPUTDATA}/QB_TOULOUSE_MUL_Extract_500_500.tif
  -dem ${INPUTDATA}/DEM/srtm_directory
  -gcp
  2000 2000 1.4181 43.6147 135.084
  2000 2050 1.41811 43.6135 134.185
  2000 2100 1.41812 43.6123 135.728
  2000 2150 1.41812 43.6111 140.437
  2000 2200 1.41813 43.6099 141.985
  2000 2250 1.41813 43.6087 138.257
  2000 2300 1.41814 43.6075 136.908
  2000 2350 1.41815 43.6062 129.787
  2000 2400 1.41815 43.605 126.295
  2000 2450 1.41816 43.6038 136.66
  2050 2000 1.41968 43.6147 135.682
  2050 2050 1.41969 43.6135 135
  2050 2100 1.4197 43.6123 134.7
  2050 2150 1.4197 43.6111 140.348
  2050 2200 1.41971 43.6099 143.342
  2050 2250 1.41972 43.6087 138.644
  2050 2300 1.41972 43.6075 137.985
  2050 2350 1.41973 43.6062 137.348
  2050 2400 1.41973 43.605 125.707
  2050 2450 1.41974 43.6038 130.963
  2100 2000 1.42127 43.6147 135.329
  2100 2050 1.42127 43.6135 137.984
  2100 2100 1.42128 43.6123 137.291
  2100 2150 1.42129 43.6111 138.949
  2100 2200 1.42129 43.6099 140.584
  2100 2250 1.4213 43.6087 142.13
  2100 2300 1.4213 43.6075 138.452
  2100 2350 1.42131 43.6063 137.792
  2100 2400 1.42132 43.605 136.434
  2100 2450 1.42132 43.6038 130.481
  2150 2000 1.42285 43.6147 135.332
  2150 2050 1.42286 43.6135 136.651
  2150 2100 1.42286 43.6123 136.629
  2150 2150 1.42287 43.6111 139.551
  2150 2200 1.42287 43.6099 138.204
  2150 2250 1.42288 43.6087 145.283
  2150 2300 1.42289 43.6075 137.505
  2150 2350 1.42289 43.6063 137.57
  2150 2400 1.4229 43.605 134.733
  2150 2450 1.4229 43.6038 131.314
  2200 2000 1.42443 43.6148 138.407
  2200 2050 1.42444 43.6135 139.594
  2200 2100 1.42444 43.6123 139.942
  2200 2150 1.42445 43.6111 140.982
  2200 2200 1.42446 43.6099 138.061
  2200 2250 1.42446 43.6087 143.539
  2200 2300 1.42447 43.6075 140.254
  2200 2350 1.42447 43.6063 136.862
  2200 2400 1.42448 43.605 139.257
  2200 2450 1.42449 43.6038 133.532
  2250 2000 1.42601 43.6148 140.76
  2250 2050 1.42602 43.6135 139.717
  2250 2100 1.42603 43.6123 139.331
  2250 2150 1.42603 43.6111 137.95
  2250 2200 1.42604 43.6099 136.37
  2250 2250 1.42604 43.6087 139.675
  2250 2300 1.42605 43.6075 142.744
  2250 2350 1.42606 43.6063 138.594
  2250 2400 1.42606 43.6051 142.685
  2250 2450 1.42607 43.6038 136.393
  2300 2000 1.4276 43.6148 141.979
  2300 2050 1.4276 43.6135 140.486
  2300 2100 1.42761 43.6123 142.465
  2300 2150 1.42761 43.6111 143.805
  2300 2200 1.42762 43.6099 140.161
  2300 2250 1.42762 43.6087 140.587
  2300 2300 1.42763 43.6075 142.85
  2300 2350 1.42764 43.6063 143.652
  2300 2400 1.42764 43.6051 144.587
  2300 2450 1.42765 43.6038 135.548
  2350 2000 1.42918 43.6148 139.286
  2350 2050 1.42918 43.6136 142.901
  2350 2100 1.42919 43.6123 143.92
  2350 2150 1.4292 43.6111 145.468
  2350 2200 1.4292 43.6099 142.063
  2350 2250 1.42921 43.6087 141.327
  2350 2300 1.42921 43.6075 140.21
  2350 2350 1.42922 43.6063 144.686
  2350 2400 1.42922 43.6051 142.948
  2350 2450 1.42923 43.6038 136.852
  2400 2000 1.43076 43.6148 142.428
  2400 2050 1.43077 43.6136 142.015
  2400 2100 1.43077 43.6123 141.832
  2400 2150 1.43078 43.6111 142.742
  2400 2200 1.43078 43.6099 142.89
  2400 2250 1.43079 43.6087 141.337
  2400 2300 1.43079 43.6075 140.138
  2400 2350 1.4308 43.6063 144.412
  2400 2400 1.43081 43.6051 143.224
  2400 2450 1.43081 43.6038 133.995
  2450 2000 1.43234 43.6148 142.162
  2450 2050 1.43235 43.6136 139.831
  2450 2100 1.43235 43.6123 140.736
  2450 2150 1.43236 43.6111 140.871
  2450 2200 1.43236 43.6099 142.21
  2450 2250 1.43237 43.6087 141.501
  2450 2300 1.43238 43.6075 138.911
  2450 2350 1.43238 43.6063 144.66
  2450 2400 1.43239 43.6051 144.932
  2450 2450 1.43239 43.6038 136.794
  -err 10 # Tolerance in meters, the first goal of this test
  )

otb_add_test(NAME prTvGCPsToRPCSensorModelImageCheckInputGcpPointsProjection_WithoutDEM COMMAND otbProjectionTestDriver
  otbGCPsToRPCSensorModelImageFilterCheckRpcModel
  -in ${INPUTDATA}/QB_TOULOUSE_MUL_Extract_500_500.tif
  -gcp
  2000 2000 1.41809 43.6143 0
  2000 2050 1.4181 43.6131 0
  2000 2100 1.4181 43.6119 0
  2000 2150 1.41811 43.6107 0
  2000 2200 1.41812 43.6095 0
  2000 2250 1.41812 43.6083 0
  2000 2300 1.41813 43.6071 0
  2000 2350 1.41814 43.6058 0
  2000 2400 1.41814 43.6046 0
  2000 2450 1.41815 43.6034 0
  2050 2000 1.41967 43.6143 0
  2050 2050 1.41968 43.6131 0
  2050 2100 1.41969 43.6119 0
  2050 2150 1.41969 43.6107 0
  2050 2200 1.4197 43.6095 0
  2050 2250 1.41971 43.6083 0
  2050 2300 1.41971 43.6071 0
  2050 2350 1.41972 43.6059 0
  2050 2400 1.41973 43.6046 0
  2050 2450 1.41973 43.6034 0
  2100 2000 1.42126 43.6143 0
  2100 2050 1.42126 43.6131 0
  2100 2100 1.42127 43.6119 0
  2100 2150 1.42128 43.6107 0
  2100 2200 1.42128 43.6095 0
  2100 2250 1.42129 43.6083 0
  2100 2300 1.4213 43.6071 0
  2100 2350 1.4213 43.6059 0
  2100 2400 1.42131 43.6046 0
  2100 2450 1.42132 43.6034 0
  2150 2000 1.42284 43.6143 0
  2150 2050 1.42285 43.6131 0
  2150 2100 1.42285 43.6119 0
  2150 2150 1.42286 43.6107 0
  2150 2200 1.42286 43.6095 0
  2150 2250 1.42287 43.6083 0
  2150 2300 1.42288 43.6071 0
  2150 2350 1.42288 43.6059 0
  2150 2400 1.42289 43.6046 0
  2150 2450 1.4229 43.6034 0
  2200 2000 1.42442 43.6144 0
  2200 2050 1.42443 43.6131 0
  2200 2100 1.42443 43.6119 0
  2200 2150 1.42444 43.6107 0
  2200 2200 1.42445 43.6095 0
  2200 2250 1.42445 43.6083 0
  2200 2300 1.42446 43.6071 0
  2200 2350 1.42447 43.6059 0
  2200 2400 1.42447 43.6046 0
  2200 2450 1.42448 43.6034 0
  2250 2000 1.42601 43.6144 0
  2250 2050 1.42601 43.6131 0
  2250 2100 1.42602 43.6119 0
  2250 2150 1.42602 43.6107 0
  2250 2200 1.42603 43.6095 0
  2250 2250 1.42604 43.6083 0
  2250 2300 1.42604 43.6071 0
  2250 2350 1.42605 43.6059 0
  2250 2400 1.42605 43.6047 0
  2250 2450 1.42606 43.6034 0
  2300 2000 1.42759 43.6144 0
  2300 2050 1.42759 43.6131 0
  2300 2100 1.4276 43.6119 0
  2300 2150 1.42761 43.6107 0
  2300 2200 1.42761 43.6095 0
  2300 2250 1.42762 43.6083 0
  2300 2300 1.42762 43.6071 0
  2300 2350 1.42763 43.6059 0
  2300 2400 1.42764 43.6047 0
  2300 2450 1.42764 43.6034 0
  2350 2000 1.42917 43.6144 0
  2350 2050 1.42918 43.6131 0
  2350 2100 1.42918 43.6119 0
  2350 2150 1.42919 43.6107 0
  2350 2200 1.42919 43.6095 0
  2350 2250 1.4292 43.6083 0
  2350 2300 1.42921 43.6071 0
  2350 2350 1.42921 43.6059 0
  2350 2400 1.42922 43.6047 0
  2350 2450 1.42922 43.6034 0
  2400 2000 1.43075 43.6144 0
  2400 2050 1.43076 43.6131 0
  2400 2100 1.43076 43.6119 0
  2400 2150 1.43077 43.6107 0
  2400 2200 1.43078 43.6095 0
  2400 2250 1.43078 43.6083 0
  2400 2300 1.43079 43.6071 0
  2400 2350 1.43079 43.6059 0
  2400 2400 1.4308 43.6047 0
  2400 2450 1.43081 43.6034 0
  2450 2000 1.43234 43.6144 0
  2450 2050 1.43234 43.6132 0
  2450 2100 1.43235 43.6119 0
  2450 2150 1.43235 43.6107 0
  2450 2200 1.43236 43.6095 0
  2450 2250 1.43236 43.6083 0
  2450 2300 1.43237 43.6071 0
  2450 2350 1.43238 43.6059 0
  2450 2400 1.43238 43.6047 0
  2450 2450 1.43239 43.6034 0
  -err 10 # Tolerance in meters, the first goal of this test
  )

otb_add_test(NAME prTuGeographicalDistanceNew COMMAND otbProjectionTestDriver
  otbGeographicalDistanceNew)

otb_add_test(NAME prTvGeographicalDistance COMMAND otbProjectionTestDriver
  otbGeographicalDistance
  -1.84944 53.14722
  0.14056 52.20444
  170254.85084
  ${EPSILON_4}
  )

otb_add_test(NAME prTvTileImageFilterGenericRSTransformTest_TLSE_DIMAPv2 COMMAND otbProjectionTestDriver
  otbTileImageFilterRSTransformTest
  1 3
  LARGEINPUT{PLEIADES/TLSE_JP2_DIMAPv2_PRIMARY_PMS_lossless_12bits/IMGPHR_201222215194743808/IMG_PHR1A_PMS_201201151100183_SEN_IPU_20120222_0901-001_R1C1.JP2}
  LARGEINPUT{PLEIADES/TLSE_JP2_DIMAPv2_PRIMARY_PMS_lossless_12bits/IMGPHR_201222215194743808/IMG_PHR1A_PMS_201201151100183_SEN_IPU_20120222_0901-001_R2C1.JP2}
  LARGEINPUT{PLEIADES/TLSE_JP2_DIMAPv2_PRIMARY_PMS_lossless_12bits/IMGPHR_201222215194743808/IMG_PHR1A_PMS_201201151100183_SEN_IPU_20120222_0901-001_R3C1.JP2}
  )

otb_add_test(NAME prTvTileImageFilterGenericRSTransformTest_LASVEGAS_DIMAPv1 COMMAND otbProjectionTestDriver
  otbTileImageFilterRSTransformTest
  1 3
  LARGEINPUT{PLEIADES/LASVEGAS_JP2_DIMAPv1_PRIMARY_PMS_lossless_12bits/IMGPHR_PHR1A_SENSOR_20120217_IPU_20120217_5374-001_V1/IMG_R1C1.JP2}
  LARGEINPUT{PLEIADES/LASVEGAS_JP2_DIMAPv1_PRIMARY_PMS_lossless_12bits/IMGPHR_PHR1A_SENSOR_20120217_IPU_20120217_5374-001_V1/IMG_R2C1.JP2}
  LARGEINPUT{PLEIADES/LASVEGAS_JP2_DIMAPv1_PRIMARY_PMS_lossless_12bits/IMGPHR_PHR1A_SENSOR_20120217_IPU_20120217_5374-001_V1/IMG_R3C1.JP2}
  )

otb_add_test(NAME prTvGCPsToRPCSensorModelImageFilterAndOrtho COMMAND otbProjectionTestDriver
  --compare-image ${EPSILON_4}
  ${BASELINE}/otbGCPsToRPCSensorModelImageFilterAndOrthoOutput.tif
  ${TEMP}/otbGCPsToRPCSensorModelImageFilterAndOrthoOutput.tif
  otbGCPsToRPCSensorModelImageFilterAndOrtho
  ${INPUTDATA}/QB_TOULOUSE_MUL_Extract_500_500.tif
  ${TEMP}/otbGCPsToRPCSensorModelImageFilterAndOrthoOutput.tif
  372332.21875
  4830255.50000
  507
  534
  2.5
  -2.5
  31
  N
  2000 2000 1.41809 43.6143 0
  2000 2050 1.4181 43.6131 0
  2000 2100 1.4181 43.6119 0
  2000 2150 1.41811 43.6107 0
  2000 2200 1.41812 43.6095 0
  2000 2250 1.41812 43.6083 0
  2000 2300 1.41813 43.6071 0
  2000 2350 1.41814 43.6058 0
  2000 2400 1.41814 43.6046 0
  2000 2450 1.41815 43.6034 0
  2050 2000 1.41967 43.6143 0
  2050 2050 1.41968 43.6131 0
  2050 2100 1.41969 43.6119 0
  2050 2150 1.41969 43.6107 0
  2050 2200 1.4197 43.6095 0
  2050 2250 1.41971 43.6083 0
  2050 2300 1.41971 43.6071 0
  2050 2350 1.41972 43.6059 0
  2050 2400 1.41973 43.6046 0
  2050 2450 1.41973 43.6034 0
  2100 2000 1.42126 43.6143 0
  2100 2050 1.42126 43.6131 0
  2100 2100 1.42127 43.6119 0
  2100 2150 1.42128 43.6107 0
  2100 2200 1.42128 43.6095 0
  2100 2250 1.42129 43.6083 0
  2100 2300 1.4213 43.6071 0
  2100 2350 1.4213 43.6059 0
  2100 2400 1.42131 43.6046 0
  2100 2450 1.42132 43.6034 0
  2150 2000 1.42284 43.6143 0
  2150 2050 1.42285 43.6131 0
  2150 2100 1.42285 43.6119 0
  2150 2150 1.42286 43.6107 0
  2150 2200 1.42286 43.6095 0
  2150 2250 1.42287 43.6083 0
  2150 2300 1.42288 43.6071 0
  2150 2350 1.42288 43.6059 0
  2150 2400 1.42289 43.6046 0
  2150 2450 1.4229 43.6034 0
  2200 2000 1.42442 43.6144 0
  2200 2050 1.42443 43.6131 0
  2200 2100 1.42443 43.6119 0
  2200 2150 1.42444 43.6107 0
  2200 2200 1.42445 43.6095 0
  2200 2250 1.42445 43.6083 0
  2200 2300 1.42446 43.6071 0
  2200 2350 1.42447 43.6059 0
  2200 2400 1.42447 43.6046 0
  2200 2450 1.42448 43.6034 0
  2250 2000 1.42601 43.6144 0
  2250 2050 1.42601 43.6131 0
  2250 2100 1.42602 43.6119 0
  2250 2150 1.42602 43.6107 0
  2250 2200 1.42603 43.6095 0
  2250 2250 1.42604 43.6083 0
  2250 2300 1.42604 43.6071 0
  2250 2350 1.42605 43.6059 0
  2250 2400 1.42605 43.6047 0
  2250 2450 1.42606 43.6034 0
  2300 2000 1.42759 43.6144 0
  2300 2050 1.42759 43.6131 0
  2300 2100 1.4276 43.6119 0
  2300 2150 1.42761 43.6107 0
  2300 2200 1.42761 43.6095 0
  2300 2250 1.42762 43.6083 0
  2300 2300 1.42762 43.6071 0
  2300 2350 1.42763 43.6059 0
  2300 2400 1.42764 43.6047 0
  2300 2450 1.42764 43.6034 0
  2350 2000 1.42917 43.6144 0
  2350 2050 1.42918 43.6131 0
  2350 2100 1.42918 43.6119 0
  2350 2150 1.42919 43.6107 0
  2350 2200 1.42919 43.6095 0
  2350 2250 1.4292 43.6083 0
  2350 2300 1.42921 43.6071 0
  2350 2350 1.42921 43.6059 0
  2350 2400 1.42922 43.6047 0
  2350 2450 1.42922 43.6034 0
  2400 2000 1.43075 43.6144 0
  2400 2050 1.43076 43.6131 0
  2400 2100 1.43076 43.6119 0
  2400 2150 1.43077 43.6107 0
  2400 2200 1.43078 43.6095 0
  2400 2250 1.43078 43.6083 0
  2400 2300 1.43079 43.6071 0
  2400 2350 1.43079 43.6059 0
  2400 2400 1.4308 43.6047 0
  2400 2450 1.43081 43.6034 0
  2450 2000 1.43234 43.6144 0
  2450 2050 1.43234 43.6132 0
  2450 2100 1.43235 43.6119 0
  2450 2150 1.43235 43.6107 0
  2450 2200 1.43236 43.6095 0
  2450 2250 1.43236 43.6083 0
  2450 2300 1.43237 43.6071 0
  2450 2350 1.43238 43.6059 0
  2450 2400 1.43238 43.6047 0
  2450 2450 1.43239 43.6034 0
  )

otb_add_test(NAME prTvVectorDataExtractROIandProjection COMMAND otbProjectionTestDriver
  otbVectorDataExtractROIandProjection
  LARGEINPUT{VECTOR/MidiPyrenees/roads.shp}
  )

otb_add_test(NAME prTvGCPsToRPCSensorModelImageFilterWithoutDEM COMMAND otbProjectionTestDriver
  --compare-ascii ${EPSILON_4}
  ${BASELINE_FILES}/otbGCPsToRPCSensorModelImageFilterWithoutDEMOutput.txt
  ${TEMP}/otbGCPsToRPCSensorModelImageFilterWithoutDEMOutput.txt
  otbGCPsToRPCSensorModelImageFilterWithoutDEM
  ${INPUTDATA}/QB_TOULOUSE_MUL_Extract_500_500.tif
  ${TEMP}/otbGCPsToRPCSensorModelImageFilterWithoutDEMOutput.txt
  2000 2000 1.41809 43.6143 0
  2000 2050 1.4181 43.6131 0
  2000 2100 1.4181 43.6119 0
  2000 2150 1.41811 43.6107 0
  2000 2200 1.41812 43.6095 0
  2000 2250 1.41812 43.6083 0
  2000 2300 1.41813 43.6071 0
  2000 2350 1.41814 43.6058 0
  2000 2400 1.41814 43.6046 0
  2000 2450 1.41815 43.6034 0
  2050 2000 1.41967 43.6143 0
  2050 2050 1.41968 43.6131 0
  2050 2100 1.41969 43.6119 0
  2050 2150 1.41969 43.6107 0
  2050 2200 1.4197 43.6095 0
  2050 2250 1.41971 43.6083 0
  2050 2300 1.41971 43.6071 0
  2050 2350 1.41972 43.6059 0
  2050 2400 1.41973 43.6046 0
  2050 2450 1.41973 43.6034 0
  2100 2000 1.42126 43.6143 0
  2100 2050 1.42126 43.6131 0
  2100 2100 1.42127 43.6119 0
  2100 2150 1.42128 43.6107 0
  2100 2200 1.42128 43.6095 0
  2100 2250 1.42129 43.6083 0
  2100 2300 1.4213 43.6071 0
  2100 2350 1.4213 43.6059 0
  2100 2400 1.42131 43.6046 0
  2100 2450 1.42132 43.6034 0
  2150 2000 1.42284 43.6143 0
  2150 2050 1.42285 43.6131 0
  2150 2100 1.42285 43.6119 0
  2150 2150 1.42286 43.6107 0
  2150 2200 1.42286 43.6095 0
  2150 2250 1.42287 43.6083 0
  2150 2300 1.42288 43.6071 0
  2150 2350 1.42288 43.6059 0
  2150 2400 1.42289 43.6046 0
  2150 2450 1.4229 43.6034 0
  2200 2000 1.42442 43.6144 0
  2200 2050 1.42443 43.6131 0
  2200 2100 1.42443 43.6119 0
  2200 2150 1.42444 43.6107 0
  2200 2200 1.42445 43.6095 0
  2200 2250 1.42445 43.6083 0
  2200 2300 1.42446 43.6071 0
  2200 2350 1.42447 43.6059 0
  2200 2400 1.42447 43.6046 0
  2200 2450 1.42448 43.6034 0
  2250 2000 1.42601 43.6144 0
  2250 2050 1.42601 43.6131 0
  2250 2100 1.42602 43.6119 0
  2250 2150 1.42602 43.6107 0
  2250 2200 1.42603 43.6095 0
  2250 2250 1.42604 43.6083 0
  2250 2300 1.42604 43.6071 0
  2250 2350 1.42605 43.6059 0
  2250 2400 1.42605 43.6047 0
  2250 2450 1.42606 43.6034 0
  2300 2000 1.42759 43.6144 0
  2300 2050 1.42759 43.6131 0
  2300 2100 1.4276 43.6119 0
  2300 2150 1.42761 43.6107 0
  2300 2200 1.42761 43.6095 0
  2300 2250 1.42762 43.6083 0
  2300 2300 1.42762 43.6071 0
  2300 2350 1.42763 43.6059 0
  2300 2400 1.42764 43.6047 0
  2300 2450 1.42764 43.6034 0
  2350 2000 1.42917 43.6144 0
  2350 2050 1.42918 43.6131 0
  2350 2100 1.42918 43.6119 0
  2350 2150 1.42919 43.6107 0
  2350 2200 1.42919 43.6095 0
  2350 2250 1.4292 43.6083 0
  2350 2300 1.42921 43.6071 0
  2350 2350 1.42921 43.6059 0
  2350 2400 1.42922 43.6047 0
  2350 2450 1.42922 43.6034 0
  2400 2000 1.43075 43.6144 0
  2400 2050 1.43076 43.6131 0
  2400 2100 1.43076 43.6119 0
  2400 2150 1.43077 43.6107 0
  2400 2200 1.43078 43.6095 0
  2400 2250 1.43078 43.6083 0
  2400 2300 1.43079 43.6071 0
  2400 2350 1.43079 43.6059 0
  2400 2400 1.4308 43.6047 0
  2400 2450 1.43081 43.6034 0
  2450 2000 1.43234 43.6144 0
  2450 2050 1.43234 43.6132 0
  2450 2100 1.43235 43.6119 0
  2450 2150 1.43235 43.6107 0
  2450 2200 1.43236 43.6095 0
  2450 2250 1.43236 43.6083 0
  2450 2300 1.43237 43.6071 0
  2450 2350 1.43238 43.6059 0
  2450 2400 1.43238 43.6047 0
  2450 2450 1.43239 43.6034 0
  )

otb_add_test(NAME prTvGeometriesProjectionFilterFromMapToImage COMMAND otbProjectionTestDriver
  --compare-ogr ${NOTOL}
  ${BASELINE_FILES}/prTvVectorDataProjectionFilterFromMapToImage.shp
  ${TEMP}/prTvGeometriesProjectionFilterFromMapToImage.shp
  otbGeometriesProjectionFilterFromMapToImage
  ${INPUTDATA}/ToulousePoints-examples.shp
  ${INPUTDATA}/QB_Toulouse_Ortho_PAN.tif
  ${TEMP}/prTvGeometriesProjectionFilterFromMapToImage.shp
  )

otb_add_test(NAME prTvGeometriesProjectionFilterFromMapToEPSG_UTM COMMAND otbProjectionTestDriver
  --compare-ogr ${NOTOL}
  ${BASELINE_FILES}/prTvVectorDataProjectionFilterLines.shp
  ${TEMP}/prTvGeometriesProjectionFilterFromMapToEPSG_UTM.shp
  otbGeometriesProjectionFilterFromMapToEPSG
  ${INPUTDATA}/ToulouseRoad-examples.shp
  ${TEMP}/prTvGeometriesProjectionFilterFromMapToEPSG_UTM.shp
  32631 )

otb_add_test(NAME prTvGeometriesProjectionFilterFromMapToEPSG_WGS84 COMMAND otbProjectionTestDriver
  --compare-ogr ${NOTOL}
  ${BASELINE_FILES}/prTvVectorDataProjectionFilterFromMapToGeo.kml
  ${TEMP}/prTvGeometriesProjectionFilterFromMapToEPSG_WGS84.kml
  otbGeometriesProjectionFilterFromMapToEPSG
  ${INPUTDATA}/ToulousePoints-examples.shp
  ${TEMP}/prTvGeometriesProjectionFilterFromMapToEPSG_WGS84.kml
  4326 )

otb_add_test(NAME prTvVectorDataProjectionFilterPoints COMMAND otbProjectionTestDriver
  --compare-ogr ${NOTOL}
  ${BASELINE_FILES}/prTvVectorDataProjectionFilterPoints.shp
  ${TEMP}/prTvVectorDataProjectionFilterPoints.shp
  otbVectorDataProjectionFilter
  ${INPUTDATA}/ToulousePoints-examples.shp
  ${TEMP}/prTvVectorDataProjectionFilterPoints.shp
  )

otb_add_test(NAME prTvVectorDataProjectionFilterLines COMMAND otbProjectionTestDriver
  --compare-ogr ${NOTOL}
  ${BASELINE_FILES}/prTvVectorDataProjectionFilterLines.shp
  ${TEMP}/prTvVectorDataProjectionFilterLines.shp
  otbVectorDataProjectionFilter
  ${INPUTDATA}/ToulouseRoad-examples.shp
  ${TEMP}/prTvVectorDataProjectionFilterLines.shp
  )

otb_add_test(NAME prTvVectorDataProjectionFilterPolygons COMMAND otbProjectionTestDriver
  --compare-ogr  ${NOTOL}
  ${BASELINE_FILES}/prTvVectorDataProjectionFilterPolygons.shp
  ${TEMP}/prTvVectorDataProjectionFilterPolygons.shp
  otbVectorDataProjectionFilter
  ${INPUTDATA}/Capitole-Shadows.shp
  ${TEMP}/prTvVectorDataProjectionFilterPolygons.shp
  )

otb_add_test(NAME prTvUtmMapProjection COMMAND otbProjectionTestDriver
  --compare-ascii ${EPSILON_4} ${BASELINE_FILES}/prTvUtmMapProjection.txt
  ${TEMP}/prTvUtmMapProjection.txt
  otbUtmMapProjection
  ${TEMP}/prTvUtmMapProjection.txt
  )

otb_add_test(NAME prTuVectorDataProjectionFilterNew COMMAND otbProjectionTestDriver  otbVectorDataProjectionFilterNew )

otb_add_test(NAME prTvTileMapTransform COMMAND otbProjectionTestDriver
  --compare-ascii ${EPSILON_4} ${BASELINE_FILES}/prTvTileMapTransform.txt
  ${TEMP}/prTvTileMapTransform.txt
  otbTileMapTransform
  ${TEMP}/prTvTileMapTransform.txt
  )

otb_add_test(NAME bfTvImportGeoInformationImageFilter COMMAND otbProjectionTestDriver
  --compare-metadata ${NOTOL}
  ${INPUTDATA}/HFAGeoreferenced.img
  ${TEMP}/bfTvImportGeoInformationOutput.img
  otbImportGeoInformationImageFilter
  ${INPUTDATA}/HFAGeoreferenced.img
  ${TEMP}/bfTvImportGeoInformationOutput.img
  )

otb_add_test(NAME bfTvImportGeoInformationImageFilterWithKeywordList COMMAND otbProjectionTestDriver
  --compare-ascii ${EPSILON_7}
  ${BASELINE_FILES}/bfTvImportGeoInformationKeywordListOutput.txt
  ${TEMP}/bfTvImportGeoInformationKeywordListOutput.txt
  otbImportGeoInformationImageFilterWithKeywordList
  LARGEINPUT{QUICKBIRD/TOULOUSE/000000128955_01_P001_PAN/02APR01105228-P1BS-000000128955_01_P001.TIF}
  ${TEMP}/bfTvImportGeoInformationKeywordListOutput.txt
  )

set(GenericConversionChecking_INPUTS
  LARGEINPUT{QUICKBIRD/TOULOUSE/000000128955_01_P001_PAN/02APR01105228-P1BS-000000128955_01_P001.TIF}
  #LARGEINPUT{SPOT4/RIO_DE_JANEIRO/IMAG_01.DAT
  LARGEINPUT{SPOT5/TEHERAN/IMAGERY.TIF}
  LARGEINPUT{RADARSAT1/GOMA2/SCENE01/DAT_01.001}
  LARGEINPUT{RADARSAT2/ALTONA/Fine_Quad-Pol_Dataset/PK6621_DK406_FQ9_20080405_124900_HH_VV_HV_VH_SLC_Altona/imagery_HH.tif}
  LARGEINPUT{FORMOSAT/Sudouest_20071013_MS_fmsat/IMAGERY.TIF}
  #LARGEINPUT{GEOEYE/LES_ROCHES/po_350134_bgrn_0000000.tif
  #LARGEINPUT{IKONOS/BLOSSEVILLE/po_2619900_pan_0000000.tif
  #LARGEINPUT{PALSAR/ALOS-H1_1__A-ORBIT__ALPSRP037120700.tif
  #LARGEINPUT{WORLDVIEW2/ROME/WV-2_standard_8band_bundle_16bit/052298844010_01_P001_PAN/09DEC10103019-P2AS-052298844010_01_P001.TIF
  LARGEINPUT{TERRASARX/PANGKALANBUUN/TSX1_SAR__SSC______SM_D_SRA_20080313T221955_20080313T222003.xml}
  LARGEINPUT{ENVISAT_ASAR_SCENE01/ASA_APS_1PNDPA20030821_7713.N1}
  #LARGEINPUT{COSMOSKYMED/Toulouse_spotlight/CSKS3_GTC_B_S2_08_HH_RD_SF_20110418180325_20110418180332.h5
  #LARGEINPUT{MODIS/MOD13Q1/MOD13Q1.A2010001.h17v05.005.2010028003734.hdf
  #LARGEINPUT{ONERA/spa3_0215_rad.dat
  #LARGEINPUT{RAPIDEYE/level3A/2008-12-25T005918_RE3_3A-NAC_752656_40091.tif
  )

set(GenericConversionChecking_TYPES
	QUICKBIRD
	#SPOT4
	SPOT5
	RADARSAT1
	RADARSAT2
	FORMOSAT
	#GEOEYE
	#IKONOS
	#PALSAR
	#WORLDVIEW2
	TERRASARX
	ENVISAT
	#COSMOSKYMED
	#MODIS
	#ONERA
	#RAPIDEYE
	)

set(GenericConversionChecking_TOL_PIX
	24 # according to DigitalGlobe specification
	#30
	30
	30
	30
	30
	#30
	#30
	#30
	#30
	30
	30
	#30
	#30
	#30
	#30
	)

set(GenericConversionChecking_TOL_M
	23 # according to DigitalGlobe specification
	#30
	30
	30
	30
	30
	#30
	#30
	#30
	#30
	#30
	30
	30
	#30
	#30
	#30
	)

set( GenericConversionChecking_TESTNB 0)

foreach( file ${GenericConversionChecking_INPUTS} )
  list(GET GenericConversionChecking_TYPES   ${GenericConversionChecking_TESTNB} current_type   )
  list(GET GenericConversionChecking_TOL_PIX ${GenericConversionChecking_TESTNB} current_tol_pix)
  list(GET GenericConversionChecking_TOL_M   ${GenericConversionChecking_TESTNB} current_tol_m  )
  math(EXPR GenericConversionChecking_TESTNB "${GenericConversionChecking_TESTNB} + 1")
  
  otb_add_test(NAME prTvGenericRSTransformGenericConversionCheckingFromGCP_${current_type} COMMAND otbProjectionTestDriver
    otbGenericRSTransformGenericConversionCheckingFromGCP
      ${file}
      ${INPUTDATA}/DEM/srtm_directory/
      ${INPUTDATA}/DEM/egm96.grd #Not used
      ${current_tol_pix} # Tolerance in pixels
      ${current_tol_m}   # Tolerance in meters
      1                  # Verbose
  )
endforeach()

set(VectorDataIntoImage_FILES
    LARGEINPUT{QB_EXTRACT/qb_extract_00_withgeom.tif}
    LARGEINPUT{QB_EXTRACT/qb_extract_00_withgeom_ENVI.hdr}
    LARGEINPUT{QB_EXTRACT/qb_extract_11_withgeom.tif}
    LARGEINPUT{QB_EXTRACT/qb_extract_11_withgeom_ENVI.hdr}
    LARGEINPUT{QB_EXTRACT/qb_utm.tif}
    LARGEINPUT{QB_EXTRACT/qb_utm_withgeom.tif}
    LARGEINPUT{QB_EXTRACT/qb_wgs84.tif}
    LARGEINPUT{QB_EXTRACT/qb_wgs84_withgeom.tif}
    LARGEINPUT{QB_EXTRACT/qb_wgs84_worldfile.tif}
    )

  set( VectorDataIntoImage_TESTNB 0)
  
  foreach( file ${VectorDataIntoImage_FILES} )
    math(EXPR VectorDataIntoImage_TESTNB "${VectorDataIntoImage_TESTNB} + 1")
    otb_add_test(NAME prTvVectorDataIntoImageProjectionFilter_${VectorDataIntoImage_TESTNB} COMMAND otbProjectionTestDriver
      otbVectorDataIntoImageProjectionFilterTest
      ${file}
      ${OTB_DATA_LARGEINPUT_ROOT}/VECTOR/MidiPyrenees/natural.shp
      ${INPUTDATA}/DEM/srtm_directory
      3 )
  endforeach()
  

  set(SENSOR_TYPES
    "QUICKBIRD/TOULOUSE/000000128955_01_P001_PAN/02APR01105228-P1BS-000000128955_01_P001.TIF"
    "GEOEYE/LES_ROCHES/po_350134_bgrn_0000000.tif"
    "WORLDVIEW2/ROME/WV-2_standard_8band_bundle_16bit/052298844010_01_P001_MUL/09DEC10103019-M2AS-052298844010_01_P001.TIF"
    )
  
  foreach( file ${SENSOR_TYPES})
    # Get the sensor name
    set(sharp_regexp "([0-9A-Za-z_]*)[ ]*/[ ]*(.*)")
    string(REGEX REPLACE "${sharp_regexp}" "\\1" sensor_name "${file}")
    # Tests
    otb_add_test(NAME prTvotbGenericRSResampleImageFilterFromMap_${sensor_name} COMMAND otbProjectionTestDriver
      --compare-image ${EPSILON_4}
      ${BASELINE}/prTvotbGenericRSResampleImageFilterOutputFromMap_${sensor_name}.tif
      ${TEMP}/prTvotbGenericRSResampleImageFilterOutputFromMap_${sensor_name}.tif
      otbGenericRSResampleImageFilterFromMap
      LARGEINPUT{${file}}
      15
      0
      ${TEMP}/prTvotbGenericRSResampleImageFilterOutputFromMap_${sensor_name}.tif
      )
  endforeach()
